//获取url参数
export const getUrlParams = () => {
    const url = window.location.search.substring(1)
    const arr = url.split('&')
    let parmas = {}
    arr.forEach(el => {
      const keyvalue = el.split("=")
      parmas[keyvalue[0]] = keyvalue[1]
    })
    return parmas
  }
  
  //从缓存中拿到url参数
  export const getParamsFromStorage = () => {
    const paramsJSON = sessionStorage.getItem('params') || '{}'
    console.log(paramsJSON)
    const params = JSON.parse(decodeURIComponent(paramsJSON))
    return params
  }